//
//  DesignerViewController.m
//  CarOfHome2
//
//  Created by 微 醺 on 15/9/29.
//  Copyright (c) 2015年 Frank. All rights reserved.
//

#import "DesignerViewController.h"
#import "DDesignerView.h"
#import "DDesignerModel.h"


@interface DesignerViewController ()

@property (nonatomic, strong) UIButton *backButton;
@property (nonatomic, assign) NSInteger count;
@property (nonatomic, strong) DDesignerView *DDview;

@end

@implementation DesignerViewController
- (void)viewWillAppear:(BOOL)animated
{
    
    AppDelegate *dele = [[UIApplication sharedApplication]delegate];
    if (dele.isNight == 1) {
        self.view.backgroundColor = [UIColor blackColor];
        
    }
    else{
        self.view.backgroundColor = [UIColor whiteColor];
           }

}

//隐藏StatusBar
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleDefault;
    //UIStatusBarStyleDefault = 0 黑色文字，浅色背景时使用
    //UIStatusBarStyleLightContent = 1 白色文字，深色背景时使用
}

- (BOOL)prefersStatusBarHidden
{
    return YES; // 返回NO表示要显示，返回YES将hiden
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.count = 1;
    
    [self infoView];
    [self logo];
}


- (void)logo
{
    self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.backButton.frame = CGRectMake(SAWindth *15, SAHeight * 15, SAWindth *30, SAHeight * 30);
    self.backButton.layer.cornerRadius = 15;
    self.backButton.backgroundColor = [UIColor blackColor];
    self.backButton.alpha = 0.5;
    [self.backButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    [self.view addSubview:self.backButton];
    [self.backButton addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)back:(UIButton *)button
{

    [self.navigationController popViewControllerAnimated:YES];
}

- (void)infoView
{
    self.DDview = [[DDesignerView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    self.DDview.model = self.model;
    [self.view addSubview:self.DDview];
}














- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
